package com.zhuss.controller.core;

import java.util.ArrayList;
import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;

import com.zhuss.bean.bo.SearchKeyWordBo;
import com.zhuss.bean.vo.DetailKeyWordVo;
import com.zhuss.bean.vo.KeyWordBean;
import com.zhuss.common.BaseController;
import com.zhuss.common.PageVo;
import com.zhuss.exception.WpsException;
import com.zhuss.opus.processor.InvitRead;


/**
 * 全局搜索
 *  controller
 * @Author zhushanshuo
   @Date 2019-11-27 19:58
 *
 */
  
@RestController
@RequestMapping("/search")
public class SearchController extends BaseController {
	
	@Autowired
	private InvitRead invitRead;
	
	/**
	 * 关键字搜索
	 * @return
	 * @throws WpsException
	 */
	@ResponseBody
	@RequestMapping("/keyWord")
	public List<KeyWordBean> keyWord(@RequestBody SearchKeyWordBo bo) throws WpsException {
		//bo.setPageSize(3);
		List<KeyWordBean> result = new ArrayList<>();
		PageVo<DetailKeyWordVo> list = invitRead.keyWord(bo);
		KeyWordBean bean = new KeyWordBean();
		bean.setPageVo(list);
		result.add(bean);
		return result;
	}
	
}
